<script type="text/javascript">
$(document).ready(function(){
	$("#editor").on("click",function(){
		var id = $("input[name='id']").val();
		var name =  $("input[name='name']").val();
		var grade = $("input[name='grade']").val();
		var code = $("input[name='code']").val();
		var status = $('input:radio[name="status"]:checked').val();
		var introduction = $("textarea[name='introduction']").val();
		$.post("${path}/role/addRole",{
			id:id,
			name:name,
			grade:grade,
			status:status,
			code:code,
			introduction:introduction
			}
		,function(data){
			if(data.success){
				window.location.href="${path}/role/list";
			}
		}); 
	})
});
</script>
<div>
	<h4>角色修改</h4>
	<input name= "id" type="hidden" value="${role.id}"><br/>
	角色名称：
	#if($role.name)
		<input name= "name" value="${role.name}">
	#else 
		<input name= "name" value="">
	#end <br/>
	角色等级：
	#if($role.grade)
		<input name= "grade" value="${role.grade}">
	#else 
		<input name= "grade" value="">
	#end <br/>
	角色代码：
	#if($role.code)
		<input name= "code" value="${role.code}">
	#else 
		<input name= "code" value="">
	#end <br/>
	角色状态：<input id="z1" type="radio" value="0" name="status" #if($role.status == 0) checked #end/>正常启用
		 	  <input id="z2" type="radio" value="1" name="status" #if($role.status == 1) checked #end/>异常  <br/>
	描述：
	#if($role.introduction)
		<textarea name="introduction" value="">${role.introduction}</textarea>
	#else 
		<textarea name="introduction" value=""></textarea>
	#end <br/>
	<button id="editor">修改</button>
</div>